/*********************************************************************************
Organization 					: 				Georgia Institute of Technology
  
Institute 						:				Cognitive Computing Group(CCL)
 
Authors							: 				Santiago Ontanon
 												
Class							:				NotCondition
 
Function						: 				Provides a class for holding 
												the not soft condition class
****************************************************************************/
package planninglanguage.softconditions;

import base.WargusGameState;


public class NotSoftCondition extends SoftCondition {

	SoftCondition m_c;

	public NotSoftCondition(SoftCondition a_c)
	{
		m_c=a_c;
	}
	
	public void reset()
	{
		m_c.reset();
	}	
	public String toString() {
		return m_c.toString(0);
	}	
	
	public float test(WargusGameState a_gameState)
	{
		return 1.0f-m_c.test(a_gameState);
	}
	
	public String toString(int tabs) {
		String str= super.toString(tabs);
		int i;
		
		for(i=0;i<tabs;i++) str = str + "  ";
		str = str +  "SoftNot(\n";
		if (m_c!=null)	{
			str = str + m_c.toString(tabs+1) + "\n";
		} else {
			for(i=0;i<tabs+1;i++) str = str + "  ";
			str = str +  "null\n";
		}  
		for(i=0;i<tabs;i++) str = str + "  ";
		str = str +  ")";
		return str;
	}		
}
